bitkeeper revision 1.1159.272.10 (4242f845cpppoqILZOUsc9BDNxlTUA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 24 Mar 2005 17:26:29 +0000 (17:26 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 24 Mar 2005 17:26:29 +0000 (17:26 +0000)
Set a block timeout at least a jiffy ahead, to have same behaviour
as native Linux.
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c

index 5d09ae6a0a944a2471fc35691f4ef4572759710a..bf8e8f9d9006ae82108388835275faeb376c089f 100644 (file)
@@ -673,6 +673,7 @@ int set_timeout_timer(void)
 {
        u64 alarm = 0;
        int ret = 0;
+       unsigned long j;
 
        /*
         * This is safe against long blocking (since calculations are
@@ -681,7 +682,10 @@ int set_timeout_timer(void)
         * would first get locked out. It is safe against normal
         * updates of jiffies since interrupts are off.
         */
-       alarm = __jiffies_to_st(next_timer_interrupt());
+       j = next_timer_interrupt();
+       if (j < (jiffies + 1))
+               j = jiffies + 1;
+       alarm = __jiffies_to_st(j);
 
        /* Failure is pretty bad, but we'd best soldier on. */
        if ( HYPERVISOR_set_timer_op(alarm) != 0 )